package cn.topcodes.tcsf.admin.domain.form;

import cn.topcode.unicorn.utils.In;
import cn.topcodes.tcsf.admin.commons.domain.Idable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import static cn.topcodes.tcsf.admin.commons.domain.ValueRangeConstant.*;

@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class UpdateSysUserForm implements Idable {

    @NotNull(message = "ID不能为空")
	private Long id;

	@NotBlank(message = "用户名不能为空")
    @Length(min = 1,max = 20,message = "用户名最大长度为20个字符")
	private String username;

	@Length(min = 0,max = 20,message = "手机号长度最大长度为20个字符")
    private String tel;

    @Length(min = 0,max = 50,message = "邮箱长度最大长度为50个字符")
    private String email;

    private Long deptId;

    @NotNull(message = "角色不能为空")
    private Long roleId;

    @Length(min = 1,max = 10,message = "真实姓名最大长度为10个字符")
    private String realName;

    @Length(min = 0,max = 100,message = "描述最大长度为100个字符")
    private String description;

    @In(values = {Gender.GENDER_MALE, Gender.GENDER_FEMALE, Gender.GENDER_UNKNOWN},
        message = "性别取值不正确")
    private String gender;

}
